package cn.dhn_app.horseman_app.controller;


import cn.dhn_app.horseman_app.service.impl.HorsemanLoginServiceImpl;
import cn.dhn_app.util.Idcard.AipOcr;
import cn.itcast.util.ResponseEntity;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author lyy
 * @Description TODO
 * @PACKAGE_NAME: cn.dhn_app.horesman_app.controller
 * @ClassName horesmanController
 * @Date 2020/8/12 17:31
 * @DAY_NAME_FULL: 星期三
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping(value = "/dhn/horseman",produces = "application/json;charset=UTF-8")
public class HorsemanLoginController {

    @Resource
    private HorsemanLoginServiceImpl horsemanLoginService;

    /**
     * 功能描述: <br>
     * 〈骑手端手机号码登录〉
     * @Author: lyy
     * @Date: 2020/8/12 17:49
     * @Param: [number, pwd]s
     * @Return: cn.itcast.util.ResponseEntity
     */
    @RequestMapping(value = "/Login")
    public ResponseEntity horsemanLogin(@RequestBody Map<String,String> map){

        log.info("开始骑手端账户密码登录······");

        String number = map.get("number");  //登录账号

        String pwd = map.get("pwd");        //登录密码

        String type = map.get("type");      //登录类型

        return horsemanLoginService.horsemanLogin(number, pwd, Long.valueOf(type));
    }
}